```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>路径总和算法可视化</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
        }
        .code-block {
            background-color: #1e293b;
            border-left: 4px solid #8b5cf6;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .concept-icon {
            color: #8b5cf6;
            font-size: 1.5rem;
        }
        .divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(156, 163, 175, 0.5), transparent);
        }
    </style>
</head>
<body class="min-h-screen">
    <div class="hero-gradient text-white py-20 px-4 sm:px-6 lg:px-8">
        <div class="max-w-4xl mx-auto text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">路径总和算法解析</h1>
            <p class="text-xl md:text-2xl opacity-90 mb-8">探索二叉树中从根到叶子的路径奥秘</p>
            <div class="inline-flex items-center space-x-2 bg-white/20 backdrop-blur-sm rounded-full px-6 py-2">
                <i class="fas fa-code text-purple-200"></i>
                <span class="font-medium">算法可视化</span>
            </div>
        </div>
    </div>

    <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
            <div class="lg:col-span-2 space-y-8">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-purple-100 p-2 rounded-full mr-3">
                                <i class="fas fa-tree text-purple-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">题目描述</h2>
                        </div>
                        <p class="text-gray-700 leading-relaxed">
                            给定一个二叉树和一个目标和，判断该树中是否存在根节点到叶子节点的路径，这条路径上所有节点值相加等于目标和。
                            <br><br>
                            例如，给定二叉树 <code class="bg-gray-100 px-2 py-1 rounded">[5,4,8,11,null,13,4,7,2,null,null,null,1]</code> 和目标和 22，
                            存在路径 <span class="font-semibold text-purple-600">5→4→11→2</span>，节点值之和为 22。
                        </p>
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-blue-100 p-2 rounded-full mr-3">
                                <i class="fas fa-brain text-blue-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">解题思路</h2>
                        </div>
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 h-10 w-10 rounded-full bg-purple-50 flex items-center justify-center mr-3">
                                    <i class="fas fa-search text-purple-600"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-gray-800">递归检查</h4>
                                    <p class="text-gray-700">从根节点开始，递归检查从根到叶子的路径和是否等于目标值。</p>
                                </div>
                            </div>
                            <div class="flex items-start">
                                <div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-50 flex items-center justify-center mr-3">
                                    <i class="fas fa-leaf text-blue-600"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-gray-800">终止条件</h4>
                                    <p class="text-gray-700">到达叶子节点时，检查剩余目标值是否等于当前节点值。</p>
                                </div>
                            </div>
                            <div class="flex items-start">
                                <div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-50 flex items-center justify-center mr-3">
                                    <i class="fas fa-clock text-green-600"></i>
                                </div>
                                <div>
                                    <h4 class="text-lg font-semibold text-gray-800">复杂度分析</h4>
                                    <p class="text-gray-700">时间复杂度：O(n)，空间复杂度：O(h)，其中h为树的高度。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-amber-100 p-2 rounded-full mr-3">
                                <i class="fas fa-code text-amber-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">示例代码</h2>
                        </div>
                        <div class="code-block rounded-lg p-4 text-gray-100 font-mono overflow-x-auto">
                            <pre><code class="language-python">def hasPathSum(root, targetSum):
    if not root:
        return False
    if not root.left and not root.right:
        return targetSum == root.val
    return (hasPathSum(root.left, targetSum - root.val) or 
            hasPathSum(root.right, targetSum - root.val))</code></pre>
                        </div>
                        <div class="mt-4 flex items-center text-sm text-gray-600">
                            <i class="fas fa-info-circle mr-2"></i>
                            <span>Python实现，适用于大多数二叉树路径求和问题</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="space-y-8">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-pink-100 p-2 rounded-full mr-3">
                                <i class="fas fa-project-diagram text-pink-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">算法可视化</h2>
                        </div>
                        <div class="mermaid">
                            graph TD
                            A[5] --> B[4]
                            A --> C[8]
                            B --> D[11]
                            D --> F[7]
                            D --> G[2]
                            C --> E[13]
                            C --> H[4]
                            H --> I[1]
                            style A fill:#8b5cf6,color:white,stroke-width:0
                            style B fill:#6d28d9,color:white,stroke-width:0
                            style D fill:#5b21b6,color:white,stroke-width:0
                            style G fill:#4c1d95,color:white,stroke-width:0
                        </div>
                        <div class="mt-4 bg-purple-50 rounded-lg p-3">
                            <div class="flex items-center text-purple-800">
                                <i class="fas fa-lightbulb mr-2"></i>
                                <span class="font-medium">路径示例</span>
                            </div>
                            <p class="mt-2 text-purple-700 text-sm">
                                示例路径: <span class="font-bold">5 → 4 → 11 → 2</span> 总和为 22
                            </p>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-emerald-100 p-2 rounded-full mr-3">
                                <i class="fas fa-question-circle text-emerald-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">关键概念</h2>
                        </div>
                        <div class="space-y-3">
                            <div class="flex items-start">
                                <i class="fas fa-circle-notch concept-icon mt-1 mr-3"></i>
                                <div>
                                    <h4 class="font-semibold text-gray-800">递归</h4>
                                    <p class="text-gray-700 text-sm">函数调用自身来解决问题的方法</p>
                                </div>
                            </div>
                            <div class="divider my-2"></div>
                            <div class="flex items-start">
                                <i class="fas fa-sitemap concept-icon mt-1 mr-3"></i>
                                <div>
                                    <h4 class="font-semibold text-gray-800">深度优先搜索(DFS)</h4>
                                    <p class="text-gray-700 text-sm">沿树的深度遍历节点的算法策略</p>
                                </div>
                            </div>
                            <div class="divider my-2"></div>
                            <div class="flex items-start">
                                <i class="fas fa-binary-tree concept-icon mt-1 mr-3"></i>
                                <div>
                                    <h4 class="font-semibold text-gray-800">叶子节点</h4>
                                    <p class="text-gray-700 text-sm">没有子节点的终端节点</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-cyan-100 p-2 rounded-full mr-3">
                                <i class="fas fa-chart-line text-cyan-600"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">复杂度分析</h2>
                        </div>
                        <div class="space-y-4">
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">时间复杂度</span>
                                    <span class="text-sm font-semibold text-gray-700">O(n)</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-blue-600 h-2 rounded-full" style="width: 100%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">空间复杂度</span>
                                    <span class="text-sm font-semibold text-gray-700">O(h)</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-purple-600 h-2 rounded-full" style="width: 60%"></div>
                                </div>
                            </div>
                        </div>
                        <div class="mt-4 text-sm text-gray-600">
                            <p>n: 树中节点总数</p>
                            <p>h: 树的高度</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```